Detecting gas compounds for downhole fluid analysis using microfluidics and reagent with optical signature

ABSTRACT

A gas separation and detection tool for performing in situ analysis of borehole fluid is described. The tool operates by introducing a reagent to a test sample and causing the resulting mixture to flow through a microfluidic channel where optical testing is performed. The optical testing detects a change in a characteristic of the reagent in response to expose to one or more particular substances in the test sample. The test sample may be borehole fluid, a mixture of borehole fluid and scrubbing fluid subsequently mixed with reagent, a mixture of reagent and gas separated from borehole fluid, or a mixture of scrubbing fluid and gas separated from borehole fluid which is subsequently mixed with reagent. A membrane may be employed to separate one or more target gasses from the borehole fluid.

FIELD OF THE INVENTION

The invention is generally related to analysis of borehole fluid, and more particularly to in situ detection of gaseous compounds in a borehole fluid using a reagent which exhibits an optical signature in a microfluidic channel in response to exposure to certain substances.

BACKGROUND OF THE INVENTION

Phase behavior and chemical composition of borehole fluids are known to be useful information. For example, concentration of gaseous components such as carbon dioxide, hydrogen sulfide and methane in borehole fluid are indicators of the economic viability of a hydrocarbon reservoir. Concentrations of CO₂ and H₂S are of interest because CO₂ corrosion and H₂S stress cracking caused by relatively high concentrations are leading causes of mechanical failure of production equipment. CH₄ concentration is of interest as an indicator of the calorific value of gas wells. It is therefore desirable to be able to perform fluid analysis quickly, accurately, reliably, and at low cost.

A variety of techniques and equipment are available for performing fluid analysis in a laboratory. However, retrieving samples for laboratory analysis is time consuming and prone to error. Due to the difference in environmental conditions between a location in a borehole and a location at the surface, and other factors, some of the characteristics of borehole fluids change when the fluids are brought to the surface. For example, because hydrogen sulfide gas readily forms non-volatile and insoluble metal sulfides by reaction with many metals and metal oxides, analysis of a fluid sample retrieved with a metallic container can produce an inaccurate estimate of sulfide content. This presents a technological problem because fluid analysis techniques that are known for use at the surface are generally impractical in the borehole environment due to size limitations, extreme temperature, extreme pressure, presence of water, and other factors. Another technological problem is isolation of gases, and particular species of gas, from the borehole fluid, which commonly exist as multiphase fluids in borehole.

The technological problems associated with detection of gas in fluids have been studied in this and other fields of research. For example, US20040045350A1, US20030206026A1, US20020121370A1, GB2415047A, GB2363809A, GB2359631A, U.S. Pat. No. 6,995,360B2, U.S. Pat. No. 6,939,717B2, WO2005066618A1, WO2005017514A1, WO2005121779A1, US20050269499A1, and US20030134426A1 describe an electrochemical method for H2S detection using membrane separation. US20040045350A1, GB2415047A, and GB2371621A describe detecting gas compounds by combining infrared spectrophotometry and a membrane separation process. US20060008913 AI describes the use of a perfluoro-based polymer for oil-water separation in microfluidic system. US2006000382A1 describes a microfluidic system for downhole chemical analysis which samples a portion of water based sample fluid and mixes it with pH sensitive reagent for low temperature pH measurement applications. Toda et al. (Lab Chip, 2005, 5, 1374-1379) describes a system to measure H2S concentration using a calorimetric technique and honeycomb structured microchannel scrubbers. However, the system and the reagent described are not suitable for use in a downhole environment such as that encountered in oilfield operations. U.S. Pat. No. 6,925,392B2 describes a microfluidic device which reacts to specific characteristics of a fluid during operations. The device is recovered and subjected to analysis to measure the desired characteristics such as resistivity, chloride, calcium concentration and other fluid properties. However, a real-time microfluidic-based sensing system capable of operation over a wide temperature and pressure range and in harsh conditions such as those encountered in oilfield operations has not yet been developed.

SUMMARY OF THE INVENTION

In accordance with an embodiment of the invention, apparatus for detecting a substance of interest in a borehole fluid in a borehole comprises: a first port through which a test sample fluid is introduced; a second port through which a reagent is introduced to the test sample fluid, thereby creating a mixed fluid, the mixed fluid exhibiting a characteristic change if the substance of interest is present in the borehole fluid; a microfluidic device into which the mixed fluid is introduced; a test module that detects, within the borehole, the characteristic change in the mixed fluid in the microfluidic channel; and a transmitter that outputs a signal indicative of whether the characteristic change is detected.

In accordance with another embodiment of the invention, a method for detecting a substance of interest in a borehole fluid comprises: introducing a test sample fluid via a first port; introducing a reagent to the test sample fluid via a second port, thereby creating a mixed fluid, the mixed fluid exhibiting a characteristic change if the substance of interest is present in the borehole fluid; causing at least some of the mixed fluid to flow into a microfluidic device; detecting, within the borehole, the characteristic change in the mixed fluid in the microfluidic channel with a test module; and transmitting an output signal indicative of whether the characteristic change is detected.

One of the advantages of the invention is that borehole fluid can be analyzed in situ. In particular, the reagent is introduced to the test sample fluid and the mixture is tested within the borehole. Consequently, time consuming fluid retrieval and errors caused by changes to fluid samples due to changes in conditions between the borehole and the environment are at least mitigated.

The use of microfluidic technology helps to achieve some of the advantages of the invention. Generally, microfluidics is a technique for processing and manipulating volumes of fluid on the order of nanoliters in a micrometer scaled channel known as a microchannel. As a result, fluid flow is laminar within the microchannel. A static or active mixer module may therefore used to enhance mixing of fluids and achieving a mixing ratio value of the mixed fluids. Microfluidics is distinct because manipulation of microliters of fluid in a laminar flow regime offers fundamentally new capabilities in the control of concentrations of molecules in space and time, the result of which facilitates detection of physical properties. It will therefore be appreciated that microfluidic technology offers advantages for analytical applications including small footprint, small sample and reagent volumes, the ability to carry out various processes such as separation and detection with high resolution and sensitivity, and low cost and reduced analysis time.

BRIEF DESCRIPTION OF THE FIGURES

FIG. 1 illustrates a logging tool for gas separation and detection in a borehole.

FIG. 2 illustrates introduction of reagent fluid and optical testing in the microfluidic channel in greater detail.

FIG. 3 illustrates an embodiment in which borehole fluid is mixed directly with reagent fluid prior to testing.

FIGS. 4 a through 4 c illustrate mechanisms to deliver test sample fluid and reagent into the microfluidic device,

FIGS. 5 a through 5 c illustrate integration of the mixing and optics functions into the microfluidic channel.

FIG. 6 illustrates alternative embodiments of the microfluidic optics. FIG. 7 illustrates an embodiment in which scrubbing fluid is mixed with borehole fluid to create an intermediate fluid which is subsequently mixed with reagent fluid prior to testing.

FIG. 8 illustrates an embodiment in which gas is separated from the borehole fluid using a membrane, and the reagent fluid is mixed with the separated gas prior to testing.

FIG. 9 illustrates an embodiment in which gas is separated from the borehole fluid using a membrane, the scrubbing fluid is mixed with the separated gas, and reagent fluid is subsequently mixed with the scrubbing fluid/gas mixture prior to testing.

FIGS. 10 and 11 illustrate the use of a thin capillary membrane.

FIGS. 12 and 13 illustrate an embodiment in which a 6-port valve and sample loop are used to introduce fluids prior to measurement.

FIGS. 14 a through 14 d illustrate an alternative to the 6 port valve-based system of FIGS. 12 and 13.

FIG. 14 illustrates a method in accordance with the invention.

FIG. 15 illustrates a capillary tubing support structure.

FIG. 16 illustrates an experimental flow injection analysis of dissolved sulfide in water.

FIG. 17 illustrates an experimental result of H2S gas measurement using a thin wall capillary tubing membrane based microfluidic device.

DETAILED DESCRIPTION

Referring to FIG. 1, a tool string 100 is utilized to measure characteristics of fluid in a borehole 102. The borehole may be formed through a hydrocarbon reservoir 106 adjacent to an impermeable layer 108, and various other layers which make up the overburden 110. The tool string, which may be part of a wireline logging tool string, logging-while-drilling tool string, or other device, is operable in response to a control unit 104 which may be disposed at the surface. The control unit 104 may also be capable of data analysis. The tool string 100 is connected to the control unit 104 by a logging cable for a wireline tool, or by a drill pipe string for a LWD tool. The tool string 100 includes a gas detection tool 112 which is lowered into the borehole to measure physical properties associated with fluid in the borehole or formation. Data gathered by the tool 112 may be communicated to the control unit in real time via the wireline cable or LWD telemetry.

FIG. 2 illustrates basic principles of operation of the gas detection tool 112 (FIG. 1). A reagent 200 is exposed to a test sample fluid 202 to produce a mixed fluid 204. Within the mixed fluid 204, the reagent 200, test sample fluid 202, or both, exhibit a change in at least one physical characteristic due to presence of one or more specific substances or classes of substances in the test sample fluid. For example, and without limitation, the reagent may exhibit a change in color if a substance such as CO2, or H2S, or CH4 from the test sample fluid is present in the mixed fluid. Further, the degree of characteristic change may be a function of concentration of the substance, exposure time, or both. The mixed fluid 204 is then caused to flow through a microfluidic device 206, where the mixed fluid is subjected to testing. The testing may be performed by an optical testing module designed to detect a change in color or transmissivity exhibited by the reagent. The optical module may include a low dead volume optical flow cell or a microfluidic optical flow cell. In one embodiment the optical testing module includes an optical transmitter 208 such as a UV-Vis source and optical receiver 210 such as a CCD spectrometer which detects changes in color or optical absorbance. The testing module produces an output signal which is indicative of the detected changes. Further, the output signal may be indicative of the degree of change. The output signal is provided to interpretation circuitry and software in control unit 104, which processes the output signal to characterize the test sample fluid, e.g., in terms of whether a certain gas or reaction products of a certain gas and reactants has been detected. Further processing may provide an indication of the concentration of that gas in the borehole fluid. It will be appreciated that the processing software will include a computer program product stored on a computer readable medium. As will be explained below, the test sample fluid can include various different fluids, either alone or in combination.

The reagent 200 is selected based on which gas or gasses the operator wishes to detect and measure. For example, the reagent may be selected based on ability to react with or absorb the gas or gasses of interest at a predictable rate or extent as a function of gas concentration in the borehole fluid. Further, the response of the reagent to exposure to the gas or gasses of interest should cause a characteristic change in the reagent, gas, or other substance that can be detected, and possibly measured. Examples of reagents that may be used to detect hydrogen sulfide gas include, but are not limited to, fluorescein mercuric acetate, complexes of metal cation and organic compounds and organometallic materials, combined with various appropriate solvents.

The microfluidic device 206 is defined by a rigid housing which permits light from the test module to traverse the channel from the optical transmitter to the optical receiver. The device 206 is characterized by channel diameter of around 100 nanometers to several hundred micrometers and, in the case of a rectangular channel, at least one of its internal dimension is less than several hundred micrometers. The flow of fluid within the microfluidic device is characterized by the Reynolds number,

${Re} = \frac{{LV}_{avg}\rho}{\mu}$

where L is the most relevant length scale, μ is the viscosity, r is the fluid density, and V_(avg) is the average velocity of the flow. L may be 4A/P, where A is the cross sectional area of the device and P is the wetted perimeter of the channel. Re is on the order of unity for typical microfluidic applications, and a laminar flow is expected for Newtonian fluids and fluids with negligible elasticity. In this invention Re can be up to 5, e.g., a range of 0.01 to 50 microliter/min (50 for low viscosity fluids). Because of the dimensions of the microfluidic device and the properties of the reactive fluid, the flow of the reactive fluid through the device is laminar, i.e., without turbulence.

FIG. 3 is a block diagram of an embodiment of the gas detection tool 112 (FIG. 1) in which the reagent 200 is mixed directly with borehole fluid 300. This embodiment includes at least two input ports 302, 304. One input port 302 is employed for receiving borehole fluid 300 and another input port 304 is employed for receiving the reagent 200, e.g., from a reservoir. The borehole fluid and reagent are mixed in a static mixer 306, thereby creating the mixed fluid, e.g., a metal sulfide in solution. The mixed fluid is then caused to flow through the microfluidic device 206, wherein the mixed fluid is subjected to optical testing. The tested fluid is then ejected as waste.

Various means are known for inducing fluid flow. While the particular fluid flow technique is not critical to the invention, some alternatives will be described for completeness. Generally, fluid may be caused to flow through the microfluidic device 206 by differential pressure or electrokinetic means. A positive displacement pump may be employed in order to implement pressure driven flow. Electrodes may be employed to implement electrokinetic driven flow. Electrokinetic driven flow is enabled by an electric surface charge including a double layer of counter ions which forms on the channel housing surface. When an electric field is applied across the microfluidic channel using the electrodes, the ions in the double layer move toward the electrode of opposite polarity. This causes motion of the reactive fluid near the walls of the housing, which is transferred via viscous forces into convective motion of the fluid. Other means of inducing fluid flow including but not limited to piezoelectric based micro pumps and impeller based pumps might alternatively be employed.

FIGS. 4 a through 4 c illustrate mechanisms to deliver test sample fluid and reagent into the microfluidic device. Generally, fluid flow is induced by pump, the use of borehole pressure with a fluid restrictor to regulate fluidic flows, or some combination of the techniques. FIG. 4 a specifically illustrates use of independent pumps 401, 403 for the causing the test sample fluid 202 and reagent 200, respectively, to flow into the microfluidic device 206. FIG. 4 b illustrates a variant in which a single pump 405 causes test sample fluid 202 to flow to a tee 407. From the tee 407 the fluid 202 flows in two paths: a first path into the microfluidic device 206; and a second path to a piston cylinder 409. The flow of fluid 202 into the piston cylinder 409 actuates the piston cylinder, thereby causing reagent to flow into the microfluidic device 206. A fluid restrictor 411 may be used to control the pressure and volume of reagent introduced to the microfluidic device. FIG. 4 c illustrates a variant in which borehole pressure is used to cause test sample fluid 202 to flow to the tee 407. Borehole pressure thereby actuates the piston cylinder to introduce reagent into the microfluidic device 206. A second fluid restrictor 413 is used to control the volume and pressure of test sample fluid 202 introduced to the microfluidic device 206.

The various pumps described above can be, without limitation, conventional reciprocating, piezoelectric, impeller based pumps, controllable by mechanical connections or magnetic actuation, preferably small enough to suit the size and flow rate required from microfluidic device. Some examples are described in Laser et al. 2004 J. Micromech. Microeng. 14 R35-R64; C. Yamahata, M. Chastellain, V. K. Parashar, A. Petri, H. Hofmann, and M. A. M. Gijs, “Plastic Micropump With Ferrofluidic Actuation,” J. Microelectromechanical Systems 14 (1), 2005; and Lei et al. PROCEEDINGS-INSTITUTION OF MECHANICAL ENGINEERS PART H JOURNAL OF ENGINEERING IN MEDICINE 2007, VOL 221; NUMB 2, pages 129-142.

In addition to controlling flow of the fluid to execute multiple tests, fluid flow may be varied in order to facilitate testing over a greater range of gas concentrations. Because the volume of reagent fluid exposed to separated gas is relatively small, the reagent fluid may become saturated if fluid flow rate is relatively slow between mixing and testing, gas concentration is relatively high, or both. In order to avoid saturation, and thereby facilitate measurement over a greater range of concentrations, the rate of fluid flow may be varied such that both exposure time and gas concentration as indicated by optical signature are provided as data to the control unit. It will be appreciated that slowing the rate of reagent fluid flow may enhance detection of separated gas at relatively low concentrations, whereas increasing the rather of reagent fluid flow may enhance detection of separated gas at relatively high concentrations.

FIGS. 5 a through 5 c illustrate some features of the tool implemented on a chip 555. The mixing function can be important because mixing characteristics differ between laminar flows and non-laminar flows. Typically, microfluidic flows have a high Peclet number, e.g., Pe=U.l/D, where U=average flow velocity l=channel dimension and D=molecular diffusivity. The diffusive mixing time is given by tD˜l̂2/D. Therefore, the mixing channel length required to achieve an adequate species mixing increases linearly with the Peclet number (Lm˜Pe×1). For example, an average flow velocity of 500 micrometer/s, a channel dimension of 100 micrometer and a molecular diffusivity of 10 μm2/s will require a mixing time and channel length in the order of 1000 see and 0.5 m, respectively. Variations of the mixer 306 (FIG. 3) are shown in FIG. 5 a. In most cases, a microfluidic device with a passive mixer structure such as a staggered herring bone structure 501, wherein a series of ridges are employed to induce helical flow and improve mixing efficiency (See Strook et al, Science, 295, 647-651 (2002) for a discussion of the underlying principles). The mixing function can also be accomplished with a serpentine structure 503 including a series of turns which induce mixing due to differences in distance travelled by the fluid as direction changes, i.e., faster flow at the outside of the corner than at the inside of the corner. Alternatively, a micropump such as an impeller based pump can function as a mixer. As illustrated specifically in FIG. 5 b, optical fibres 505, 507 may be mated to the microfluidic device such that light traverses a segment of the microfluidic device 206. For example, the fibres may be abutted against the channel where the channel is at a right angle. Thus, light from one fibre 505 enters and traverses the channel, and exits via another fibre 507. A variation which incorporates the mixing function into the microfluidic device, e.g., onto a single chip with the optical detection module, is illustrated specifically in FIG. 5 c. More particularly, the mixing feature and microfluidic optics are both be disposed on the chip such that the mixing function occurs upstream of the microfluidic optics.

Variations of the microfluidic optics are illustrated in FIGS. 6 a and 6 b. As shown in FIG. 6 a, the microfluidic device may function as an optical waveguide such that a non-linear optical test segment 611 is possible. In this variant the channel which contains the fluid has a reflective inner coating with a suitable refractive index such that incident light does not escape. Light is introduced to the non-linear test segment 611 via optical fibres 505, 507 as already discussed above. One advantage of this embodiment is that the length of the optical test section can be increased beyond the basic length and width of the chip 555. As shown in FIG. 6 b, the test segment may alternatively be formed by having the light traverse the microfluidic channel at right angles. In other words, the light path of the test segment 613 is linear and perpendicular to the fluid flow path. Background technology is described in Monat et al, Nature Nanophotonics, 1, 2007, 106

FIG. 7 is a schematic/block diagram illustrating that multiple mixers 502, 504 may be implemented with microfluidic device 206 optics on a single chip 555. It will also be appreciated that multiple independent test modules (microfluidic optics with or without other components, a.k.a., sample loops) may be implemented on a single chip. For example, an array including multiple one-time use test modules could be implemented with one-time use valves 777 for introducing the fluids such that the chip could be discarded after all modules were used. Alternatively, multiple reusable test modules could be implemented on the chip. One advantage of implementing an array of test modules is that characteristic such as fluid volumes and the length of optical test segment could differ between test modules, thereby supporting operation in a broader range of conditions and for a broader range of borehole fluids.

As suggested above, it may be undesirable to directly mix reagent with borehole fluid. One technique to avoid such a direct mixture is to use a scrubbing fluid 500 to create an intermediate fluid from the borehole fluid 300. The scrubbing fluid is selected to neutralize characteristics of the borehole fluid which make it unsuitable for direct mixture with reagent. The scrubbing fluid may also improve gas solubility, which is advantageous if gas solubility into the reagent is low. For example in the case of acidic gas, alkaline solution such as sodium hydroxide, alkanoamine compounds such as triethanolamine, diethanolamine, and methyldiethanolamine may be used. Organic solvents such as DMF and NMP, glycol based compounds (ethylene glycol, propylene glycol, diethylene glycol monobutyl ether) can also be used as stripping/scrubbing fluid. In practice, the scrubbing fluid and borehole fluid may be introduced to a static mixer 502 to create the test sample fluid. The test sample fluid and reagent 200 are then introduced to a second static mixer 504 to create the mixed fluid which undergoes testing in the microfluidic device 206. As discussed above, the mixers and microfluidic device optics may be implemented on one chip as a single or multiple test module configuration.

FIG. 8 is a block diagram of an alternative embodiment of the gas detection tool 112 (FIG. 1) in which the test sample fluid is a gas 400 that is separated from the borehole fluid 300 by a gas separation membrane 402. Borehole fluid 300 flows though a channel 404 on one side of the membrane, and reagent fluid 200 from a reservoir 406 flows through a channel 408 on the opposite side of the membrane 402. Openings associated with the channel 404 carrying borehole fluid may be open to the borehole in a manner which takes advantage of fluid flow within the borehole to refresh the fluid within the channel 404. The channel 408 carrying reagent is connected to the reagent reservoir 406 at one opening and to a static mixer 306 at another opening. Fluid that is mixed by the mixer flows into the microfluidic channel 206. If present, one or more particular types of gas 400 are separated from the borehole fluid 300 by the membrane 402. The reagent 200 mixes with separated gas in the static mixer 306 at the end of channel 408. The reagent 200 exhibits a change in a physical characteristic in response to exposure to the separated gas in the gas/reagent mixture. The change is then detected via optical testing in the microfluidic channel 206 as already described above. An advantage of this variant is that the reagent is not directly exposed to borehole fluid. Depending on the composition of the borehole fluid and the reagent, such separation may be desirable. For example, the borehole fluid may be so dark in color that it would induce errors in the optical testing.

The membrane 402 has characteristics that inhibit traversal by all but one or more selected compounds. Various commercially available gas separation membranes might be utilized. Such membranes are typically available as either a thin film or a thin wall tubing, either of which might be used for membrane 402. The membrane may be constructed of any of various materials, ones of which may be preferable based on downhole conditions and the substance one wishes to detect. One embodiment of the membrane is an inorganic, gas-selective, molecular separation membrane having alumina as its base structure, e.g., a DDR type zeolite membrane. Another embodiment is a polymeric membrane, such as a highly thermally stable polymeric membrane such as Teflon AF (DuPont), PDMS or microporous PTFE (Gore-Tex). In a polymeric membrane such as Teflon AF or PDMS, gas molecules permeate through the membrane via a solution-diffusion process, whereas in an inorganic or microporous membrane the gas permeates through Knudsen diffusion. In the case of a zeolite membrane, nanoporous zeolite material is grown on the top of a base material. Examples of such membranes are described in US20050229779A1, US6953493B2 and US20040173094AI. The membrane may be characterized by a pore size of about 0.3-0.7 μm, resulting in a strong affinity towards CO2. Further enhancement of separation and selectivity characteristics of the membrane can be accomplished by modifying the surface structure. For example, a water-impermeable layer such as a perfluoro-based polymer may be applied to inhibit water permeation through the membrane. Other variations of the separation membrane operate as either molecular sieves or adsorption-phase separation. These variations can formed of inorganic compounds, inorganic sol-gel, inorganic-organic hybrid compounds, inorganic base material with organic base compound impregnated inside the matrix, and any organic materials that satisfy requirements.

FIG. 9 is a block diagram of an alternative embodiment of the gas detection tool 112 (FIG. 1) in which the test sample fluid is formed by mixing scrubbing fluid 500 with a gas 400 that is separated from the borehole fluid 300 by a gas separation membrane 402. Borehole fluid 300 flows though a channel 404 on one side of the membrane 402, and scrubbing fluid 500 flows from a reservoir 600 through a channel 408 on the opposite side of the membrane. The channel 408 carrying scrubbing fluid 500 is connected to a scrubbing fluid reservoir 600 at one opening and to a static mixer 602 at another opening. If present, one or more particular types of gas 400 are separated from the borehole fluid by the membrane 402. The scrubbing fluid mixes with separated gas in the mixer 602, thereby creating a test sample fluid. The test sample fluid is then mixed with reagent 200 in a second static mixer 604. The reagent exhibits a change in a physical characteristic in response to exposure to gas in the test sample fluid. The change is then detected via optical testing in the microfluidic channel 206 as already described above.

FIGS. 10 and 11 illustrate the use of a thin capillary membrane 902 to selectively allow permeation of gas from the borehole fluid 300. The capillary membrane allows very high surface to volume ratio, and is less prone to leaking from channel to channel in comparison with a thin film membrane with a planar fluidic channel. For example, the tubing can be rolled into a compact form factor, and the necessary reagent retention time can be adjusted by adjusting tubing length or flow rate. With a thin film membrane, only flow rate can be adjusted. Further, it is relatively difficult to produce large membrane sheets. Scrubbing fluid can be employed to assist the reaction as already described above. Flowing fluid with stop-go method will also assist the detection.

Flow injection analysis, proposed by Ruzicka et al in 1974, is a reliable and reproducible method to conduct chemical analysis. A portion of the sample is introduced into a flowing stream of reagent and property changes are detected afterwards. The method's accuracy can be improved using a switching valve equipped with a sample loop.

FIGS. 12 and 13 illustrate a specific implementation of the gas detection tool 112 (FIG. 1) in which a 6-port valve 700 is used to introduce test sample fluids to a sample loop 702 prior to testing. The valve 700 has six ports, 1-6. Port 1 is used to introduce test sample fluid 202 continuously. Port 4 is used to introduce reagent 200. The valve is characterized by two distinct configurations between which the valve can be switched. In a first configuration (shown specifically in FIG. 10) port 1 is connected to port 6, port 2 is connected to port 3, and port 4 is connected to port 5. In this first configuration the test sample fluid 202 flows into port 1, to port 6, into a sample loop 702 between ports 6 and 3, and from port 3 to port 2, which is connected to a waste fluid conduit or recycling reservoir. The volume of the channel between port 1 and port 2 is known. Consequently, the volume of sample fluid in the channel, and in particular the volume of test sample fluid in the sample loop 702, is fixed and known. The reagent 200 flows continuously from port 4 to 5 and into the mixer and optical module. Baseline measurement can be conducted in this configuration. The valve 700 is then switched to a second configuration (shown specifically in FIG. 13). In the second configuration port 3 and 4 are connected, causing the reagent 200 to flow to the sample loop 700 via port. The test sample fluid and reagent are then mixed, moved through the sample loop and out of port 5 to the static mixer 704 and microfluidic channel 206 for optical testing. One of the advantages of the implementation is enhanced control over the volume of reagent introduced for each test cycle. Under specific circumstances the inlet of reagent 200 and test sample fluid 202 can be reversed.

FIGS. 14 a through 14 d illustrate an alternative to the 6 port valve-based system. This alternative embodiment includes two plunger-like piston valves 1200 made of a ferrous component coated with an inert, low friction, slightly elastic substance on the surface for better sealing. These valves 1200 can be actuated with magnetic components 1202. When the left side magnets are activated, the baseline signal of the reagent is measured. When the right side magnets are activated, the pistons slide and sample fluid enters the sample loop (middle channel). When the left side magnets are activated again, the pistons slide to the left again, and reagent swipes the “trapped” sample to the mixer and detector. Piston movements are adjusted by balancing pressures of these fluids and also to use pressure difference between these fluids to improve sealing.

Referring to FIG. 15, it will be appreciated that the invention can also be expressed in terms of a method. Initially, a sample of borehole fluid is obtained and a known volume of reagent is prepared, as indicated in steps 800, 802, respectively. Optionally, a scrubbing fluid may be prepared as indicated by step 804. Note that “prepared” implies that the fluid can be introduced at a known volume or rate of flow, and does not imply a manufacturing process. Any of various alternative techniques can then be employed to produce a test sample fluid. In one technique the known volume of reagent and borehole fluid sample are combined in step 806. In another technique a gas is separated from the borehole fluid in step 808, and the separated gas is combined with the reagent in step 810. In another technique a gas is separated from the borehole fluid in step 808, and the separated gas is combined with the scrubbing fluid in step 812, and the resulting fluid is combined with reagent in step 814. In another alternative embodiment the borehole fluid is combined with scrubbing fluid in step 816, and the resulting fluid is combined with reagent in step 818. Since any of the techniques might be employed, the results are depicted as proceeding to a logical OR step 820. The test sample fluid is then subjected to optical testing in step 822. A signal indicative of the result of the test is then transmitted to processing circuitry as indicated by step 824.

FIG. 15 illustrates a capillary tubing support structure. As discussed above, a thin capillary tubing membrane 902 can be used to selectively allow permeation of gas from the borehole fluid. The capillary membrane is advantageously characterized by a high surface to volume ratio, and is less prone to leaking from channel to channel in comparison with a thin film membrane with a planar fluidic channel. As illustrated, the tubing can be rolled into a compact form factor. In particular, the tubing membrane is wrapped around a support structure which occupies less than several percent of the entire surface area.

FIG. 16 illustrates an experimental flow injection analysis of dissolved sulfide in water. The experiment was conducted at 150 deg C., 5200 psi, using a 5 μl (microliter) sample loop. The sample fluid was injected into a flowing stream of reagent, and the color change/optical signature was detected using a microfluidic optical cell with a pathlength of 10 mm. The optical signature can be observed at 400 nm. Using 850 nm (or higher) as a baseline/reference, the difference between these two signals can be used to quantify the sulfide.

FIG. 17 illustrates an experimental result of H2S gas measurement using a thin wall capillary tubing membrane based microfluidic device. The gas permeable capillary tubing was wrapped into a mechanical support. Reagent was then flowed into the capillary tubing, e.g., at 50 μl/min, and H2S gas was flowed at the feed side, i.e., outside of the capillary tubing. The reaction product was detected using a microfluidic optical cell with a test segment pathlength of 10 mm. The signal was acquired at 400 nm and used “as is.” Baseline correction, for example at 800 nm, could be used to improve accuracy.

While the invention is described through the above exemplary embodiments, it will be understood by those of ordinary skill in the art that modification to and variation of the illustrated embodiments may be made without departing from the inventive concepts herein disclosed. Moreover, while the preferred embodiments are described in connection with various illustrative structures, one skilled in the art will recognize that the system may be embodied using a variety of specific structures. Accordingly, the invention should not be viewed as limited except by the scope and spirit of the appended claims. 

1. Apparatus for detecting a substance of interest in a borehole fluid in a borehole comprising: a first port through which a test sample fluid is introduced; a second port through which a reagent is introduced to the test sample fluid, thereby creating a mixed fluid, the mixed fluid exhibiting a characteristic change if the substance of interest is present in the borehole fluid; a microfluidic device into which the mixed fluid is introduced; a test module that detects, within the borehole, the characteristic change in the mixed fluid in the microfluidic channel; and a transmitter that outputs a signal indicative of whether the characteristic change is detected.
 2. The apparatus of claim 1 further including a component separator.
 3. The apparatus of claim 1 further including a pressure compensator to balance fluid pressure inside and outside the apparatus
 4. The apparatus of claim 1 further including a fluid delivery module to introduce each respective fluid.
 5. The apparatus of claim 1 wherein the signal outputted by the transmitter is indicative of level of concentration of the substance of interest in the borehole fluid.
 6. The apparatus of claim 1 wherein the test module includes an optical transmitter and optical receiver that detect differences in color or transmissivity.
 7. The apparatus of claim 1 wherein the reagent is selected from the group consisting of fluorescein mercuric acetate, complexes of metal cation and organic compounds and organometallic materials, combined with various appropriate solvents, and combinations thereof, suitable for both ambient and borehole condition use.
 8. The apparatus of claim 1 wherein the test sample fluid is borehole fluid.
 9. The apparatus of claim 1 wherein the test sample fluid is borehole fluid mixed with scrubbing fluid
 10. The apparatus of claim 1 wherein the microfluidic device includes an integrated mixer.
 11. The apparatus of claim 1 wherein a target compound for analysis can be transferred from one phase at feed side to another phase at permeate side.
 12. The apparatus of claim 1 wherein the microfluidic device and test module are integrated as one device.
 13. The apparatus of claim 1 further including a membrane disposed between the borehole fluid and the first port, and wherein the test sample fluid is a fluid separated from the borehole fluid by the membrane.
 14. The apparatus of claim 13 wherein the membrane includes capillary tubing.
 15. The apparatus of claim 13 wherein the membrane capillary tubing is supported by a structure that increases diffusion area.
 16. The apparatus of claim 14 wherein the capillary tubing is wound.
 17. The apparatus of claim 14 wherein the membrane includes a thin film, multilayered micro porous or nano porous membrane
 18. The apparatus of claim 1 wherein the test sample fluid is a mixture of scrubbing fluid and borehole fluid.
 19. The apparatus of claim 1 further including a membrane disposed between the borehole fluid and the first port, and wherein the test sample fluid is a mixture of scrubbing fluid and gas separated from the borehole fluid by the membrane.
 20. The apparatus of claim 1 wherein the first and second ports are part of a multi-port valve, and wherein a test loop is connected between ports of the valve in order to introduce a predetermined fixed volume of reagent.
 21. The apparatus of claim 1 adapted to operate in a borehole.
 22. The apparatus of claim 1 further including a piston for delivering at least one of the fluids in response to pumped pressure from another one of the fluids.
 23. The apparatus of claim 1 further including a piston for delivering at least one of the fluids in response to borehole pressure.
 24. The apparatus of claim 1 wherein the apparatus is pressure balanced with at least one of: a spring and piston, bellows, and diaphragm membrane.
 25. The apparatus of claim 1 further including a combined passive mixer and membrane module.
 26. The apparatus of claim 1 further including thin wall capillary tubing which functions as an optical waveguide, the tubing coupled to an optical source and detector.
 27. The apparatus of claim 1 wherein multiple sample loops are disposed between the ports on a single chip.
 28. The apparatus of claim 27 wherein the sample loops are operated by at least one of: multiposition switching valves; and one time use valves.
 29. A method for detecting a substance of interest in a borehole fluid comprising: introducing a test sample fluid via a first port; introducing a reagent to the test sample fluid via a second port, thereby creating a mixed fluid, the mixed fluid exhibiting a characteristic change if the substance of interest is present in the borehole fluid; causing at least some of the mixed fluid to flow into a microfluidic device; detecting, within the borehole, the characteristic change in the mixed fluid in the microfluidic channel with a test module; and transmitting an output signal indicative of whether the characteristic change is detected.
 30. The method of claim 29 further including transmitting an output signal indicative of level of concentration of the substance of interest in the borehole fluid.
 31. The method of claim 29 wherein the test module includes an optical transmitter and optical receiver, and further including detecting differences in color or transmissivity.
 32. The method of claim 29 wherein introducing the test sample fluid includes introducing borehole fluid.
 33. The method of claim 29 further including a membrane disposed between the borehole fluid and the first port, and wherein introducing the test sample fluid includes introducing a gas separated from the borehole fluid by the membrane.
 34. The method of claim 29 wherein introducing the test sample fluid includes introducing a mixture of scrubbing fluid and borehole fluid.
 35. The method of claim 29 further including a membrane disposed between the borehole fluid and the first port, and wherein introducing the test sample fluid includes introducing a mixture of scrubbing fluid and gas separated from the borehole fluid by the membrane.
 36. The method of claim 29 wherein the first and second ports are part of a multi-port valve, and wherein a test loop is connected between ports of the valve, and wherein introducing reagent includes causing a predetermined fixed volume of reagent to flow into the test loop. 